<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>你好，总账号</title>
  <script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/jquery"></script>
  <script src="__PUBLIC__/script/layer/layer.js"></script>
  <script src="__PUBLIC__/node_modules/datatables/media/js/jquery.dataTables.min.js"></script>
  <script src="__PUBLIC__/script/bootstrap-treeview-master/dist/bootstrap-treeview.min.js"></script>
  <link rel="stylesheet" href="__PUBLIC__/script/bootstrap-treeview-master/dist/bootstrap-treeview.min.css">
  <link rel="stylesheet" href="__PUBLIC__/node_modules/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="__PUBLIC__/style/manage.css">
  <style>
    #ifame_nav {
      height: 5rem;
    }
    @media screen and (min-width: 997px) {
      #ifame_nav {
        height: 45rem;
      }
    }
    .pass_mod,.sign_out {
      max-width: 8rem;
    }
  </style>
</head>
<body>
  <div class="container-fluid">
    <div class="row">
      <header class="col-xs-6 col-md-2 account_name"><img class='img-responsive' src="__PUBLIC__/images/logo_long.jpg" alt=""></header>
      <div class="col-xs-12 col-md-12">
        <div class="row">

          <!-- 左侧栏 -->
          <div class="col-md-2 manage_nav_box">
            <iframe src="{:U('nav')}?local=diqu" frameborder="0" width="100%" id='ifame_nav' style="height: 7rem;"></iframe>
            <!-- 账号选项 -->
            <div class="account_option">
              <a href="{:U('index/update_passwd')}" class="pass_mod">修改密码</a>
              <a href="{:U('index/loginout')}" class="sign_out">退出登录</a>
            </div>
            <!-- end 账号选型 -->
          </div>
          <!-- end 左侧栏 -->

          <!-- 右主体  -->
          <div class="col-md-10 col-md-10 messageBox">



            <!-- begin  授权地区列表列表 -->
            <header style='min-height:2rem;'>所有地区列表<a href="#"><img id="add_local_frame" src="__PUBLIC__/images/neiye/u138.png" alt="u138" title="添加授权地区"></a></header>
            <!-- end 表头 -->

            <table class="messageBoxContent table table-striped table-bordered" id="main_table">
                <thead>
                  <tr>
                    <th class="authNo">序号</th>
                    <th class="authSheng">省</th>
                    <th class="authShi">市</th>
                    <!-- <th class="authQu">区</th> -->
                    <th class="authPerson">姓名</th>
                    <th class="authPhone">手机</th>
                    <th class="authPass">密码</th>
                    <th class="authEMail">邮箱</th>
                    <th class="authDate">授权日</th>
                    <th class="authSetting">多选 <input type="checkbox" name="test" id="fuck" form='not_submit'></th>
                  </tr>
                </thead>

                <tbody>
				<volist name="list" id="vo">
                  <tr>
                    <th class="authNo">{$key+1}</th>
                    <th class="authSheng">{$vo.u_pro_id|re_data}</th>
                    <th class="authShi">{$vo.u_city_id|re_data}</th>
                    <!-- <th class="authQu">{$vo.u_area_id|re_data}</th> -->
                    <th class="authPerson">{$vo.u_name}</th>
                    <th class="authPhone">{$vo.u_phone}</th>
                    <th class="authPass">{$vo.u_pass}</th>
                    <th class="authEMail">{$vo.u_email}</th>
                    <th class="authDate">{$vo.u_time}</th>
                    <!-- 修改：value为id或者key -->
                    <th class="authSetting"><input type="checkbox" name="id_arr[]" id="diqu_1" form="delete_form" value="{$vo.u_id}"></th>
                  </tr>
				 </volist>
                </tbody>
              </table>
            <!-- end 授权地区列表列表 -->

            <!-- begin 删除选项（表单） -->
            <div class="form">
              <form autocomplete="off" action="{:U('index/del_user')}" id="delete_form" method="post">
                <input type="submit" value="删除所选" class="delete_all">
                <input type="reset" value="取消选择" class="reset_all">
              </form>
            </div>
            <!-- end 删除选项（表单） -->

            <!-- begin 分页 -->
            <div class="authPage">
                    <!-- 页面指示器 -->
                    <!-- <div class="pages">24/{$count}</div> -->
                    <!-- 分页列表 -->
                    <!-- <span class="number">...</span> -->
                    <div class="pageJump">{$page}</div>

            </div>
            <!-- end 分页 -->

          </div>
          <!-- end 右主体 -->

        </div>
      </div>
    </div>
  </div>
  <script>
    $('#add_local_frame').on('click', function(){
      layer.open({
		    type: 2,
		      title: '添加地区账号',
		    shadeClose: false,
		    shade: 0.5,
		    area: ['700px', '500px'],
		    maxmin: true,
            closeBtn: 1,
		    content: "{:U('chengshi')}" //iframe的url
		  });
    })
    $(document).ready(function() {
      var proList = $('#main_table').DataTable({
        "paging": false,
        "info": false,
        "searching": false
      })
      $('.messageBoxContent thead .authSetting').on('click', function (event) {
        event.stopPropagation();Array.from($('.messageBoxContent input[type=\'checkbox\']')).forEach(function(val,index){val.checked = !val.checked})
      })
    })
    var manage_nav = $('#manage_nav').treeview(true)
    $('#manage_nav').on('click', function(e){
      var id = e.target.getAttribute('data-nodeid')
      var url = manage_nav.getNode(id).href
      self.location = url
    })
	window.addEventListener('message', fromNav, false)
    function fromNav(event) {
      console.log(event.data.url)
      if (event.data.url.length && event.data.url.length > 1) {
        self.location = event.data.url
      }
    }
  </script>
</body>
</html>
